1. Field of the Invention
This invention relates to trace synchronization. More particularly, this invention relates to a data processing apparatus and a data processing method which control the insertion of synchronization markers into a trace data stream to enable the synchronization of the trace data.
2. Description of the Prior Art
In a data processing apparatus, there are two main methods of facilitating debugging. The first method is to use debugging techniques such as setting breakpoints to halt code execution at a specific activity and to use a debug connection between the data processing apparatus and an external debugging apparatus to examine the status of the data processing apparatus at the breakpoint. The second method is to use trace monitoring to collect from the data processing apparatus, in real time, data representing instruction execution and/or data transfers, and to deliver the data to a trace analysis apparatus. One architecture which provides for this type of trace monitoring is the ARM Embedded Trace Macrocell architecture.
Data collected from a data processing apparatus for trace monitoring purposes is referred to as trace data. The trace data may be generated by trace data sources within the data processing apparatus which receive data signals from respective elements of the data processing apparatus which are associated with the trace data sources. Examples of such elements include a central processing unit, a coprocessor and a DMA (Direct Memory Access) controller. The trace data may then be temporarily stored in a trace buffer before being delivered externally of the data processing apparatus via a trace port.
Trace data is typically compressed to reduce the amount of trace data which needs to be stored and transferred. In order to analyze a stream of trace data in this case, the position of individual data frames may need to be determined, and the decompression routines initialized. To enable these processes to be achieved, various special synchronization packets may be inserted into the trace data. The nature of the compression, and the nature of the circuit which is being traced may mean that the rate at which trace data is generated varies considerably over time.
It may frequently be the case that more trace data will be generated than is captured for later processing. Synchronization data should therefore preferably be inserted with sufficient frequency to allow that data which is captured to be processed. The synchronization process may itself be capable of generating a large amount of trace data in a short time.
Where multiple trace data sources are used to generate trace data corresponding to multiple respective elements of the data processing apparatus, the amount of trace data generated at a particular time may become large. In this case, the insertion of synchronization information into the trace data stream may result in data loss conditions within the trace monitoring circuitry of the data processing apparatus.